package com.jrh.biz.product.set;

import java.util.List;

import com.jrh.dal.ProductSetDao;
import com.jrh.domain.common.Page;
import com.jrh.domain.entity.ProductSet;

/**
 * 商品系列服务实现
 * 
 * @author yout 2012-7-24 下午7:57:07
 */
public class ProductSetServiceImpl implements ProductSetService {

    private ProductSetDao productSetDao;

    public void setProductSetDao(ProductSetDao productSetDao) {
        this.productSetDao = productSetDao;
    }

    @Override
    public void addSet(ProductSet productSet) {
        productSetDao.create(productSet);
    }

    @Override
    public void deleteSet(long id) {
        productSetDao.delete(id);

    }

    @Override
    public Page<ProductSet> listSetsByBrandId(long brandId, Integer start, Integer pageSize) {
        return productSetDao.listByCondition(brandId, start, pageSize);
    }

    @Override
    public ProductSet getProductSetById(long id) {
        return productSetDao.load(id);
    }

    @Override
    public void updateSet(ProductSet productSet) {
        productSetDao.update(productSet);
    }

    @Override
    public List<ProductSet> listSetsByBrandId(long brandId) {
        return productSetDao.listByCondition(brandId);
    }

}
